/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package himilco.projects.ocana;

import com.himilco.ocana.workflow.core.dao.shared.entities.Incident;
import com.himilco.ocana.workflow.core.dao.shared.entities.Ticket;
import javax.ejb.Stateless;
import javax.ejb.LocalBean;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author oussema
 */
@Stateless
@LocalBean
public class IncidentListener {

    @PersistenceContext(unitName = "PU_OCANA_EJB_MODULE")
    EntityManager em;

    public void saveTicket(Ticket ticket1, Incident incident1) {
        em.persist(incident1);
        em.persist(ticket1);
        System.out.println("tikcet saved");
    }
}
